<?  


$ingame = $this->session->userdata('ingame');



?>

<!--div style="overflow:auto;">
	<div style="float:right;text-align:right;font-size: 0.7em;">
	<?	if($kampagne['offgame_slut'] == 0)
		{?>
		<p class="rubrik">Start: <? echo date('Y',$kampagne['offgame_start']); ?><br/>
		Der spilles hver tirsdag</p>
	<?	}
		else
		{?>
		<p class="rubrik">Start: <? echo date('H:i d-m-Y',$kampagne['offgame_start']) ;?><br/>
		Slut: <? echo $kampagne['offgame_slut']; ?></p>
	<?	}?>
	</div>



	<h2 class="ink"><span class="rubrik">Kampagne: </span><? echo $kampagne['navn']; ?></h2>
</div-->

<h3 class="rubrik" style="margin:0px 0px 0px 0px;">Meld en karakter til <? echo $kampagne['navn']; ?></h3>
<?

if($this->input->post('soeg'))
		{

			$this->load->model('soeg/soeg_model');
			$data['kriterie'] = $this->input->post('kriterie');
			$data['omraade'] = $this->input->post('omraade');
			$data['resultater'] = $this->soeg_model->soeg($data['kriterie'], $data['omraade']);		
		}

	$data['find_ikke'] = array();
	$data['type'] = "individ";
	$data['redirect_soegning'] = "";
	$data['redirect_tilfoej'] = "deltager/kampagne/929";
	$data['omraade'] = "individer";
	$data['stam_id'] = $ingame['ingame_id'];
	$this->load->view('soeg/soeg_generel',$data);


		if($ingame['ingame_id'] == 0)
		{	?>
			<form style="text-align:left;float:right;width:250px;" action="<? echo base_url(); ?>core/rediger/begivenhed_deltager/tilfoej/<? echo $kampagne['id']; ?>" method="post">	
			<input type="submit" class="terninger" value="">
				
			<input type="hidden" name="vinkel" value="session">
			<input type="hidden" name="kampagne_id" value="<? echo $kampagne['id']; ?>">
			<select name="deltager_id" style="margin:0px;">
				<?

				foreach($alle_pcer as $r)
				{
			
						?>
							<option value="<? echo $r['id_karakter']; ?>"><? echo $r['karakter']; ?></option>
						<?
			
		
				}
				?>
			</select>

			</form>



			<h3 class="rubrik">Kampagnens hovedpersoner</h3>
				<p class="rubrik" style="padding:0px 0px 10px 0px;">
				<?
				foreach($kampagne_hovedpersoner as $r3)
				{
					echo "<span class='ink'>".$r3['navn']."</span><br>";
				}	

		}	

?>




<? 
if($naeste_session != 0)
{ 	?>

	<?	if($ingame['ingame_id'] != 0)
		{	?>

		
<br>
	<h3 class="rubrik">Meld dig til næste session - <? echo anchor("deltager/dashboard/".$ingame['ingame_id']."/alle_sessioner","se alle sessioner","class='rubrik'"); ?></h3>	
	<div style="padding:10px;border:solid 1px #BEBAA0;">




	<form action="<? echo base_url(); ?>core/rediger/begivenhed_deltager/tilfoej/<? echo $naeste_session['id']; ?>" method="post">	

		
		<?  $er_jeg_tilmeldt = "nej";
			foreach($rollespillere as $r3)
			{
				
				if($ingame['ingame_id'] == $r3['id'])
				{
					$er_jeg_tilmeldt = "ja";
				}

			}

			if($er_jeg_tilmeldt == "nej")
			{
		?>			<input type="submit" class="terninger" value="" title="Tilmeld <? echo $ingame['ingame_navn'];?> <? echo $naeste_session['navn'];?>" >
				<?
			}
			else
			{
				echo anchor
				(
					"core/rediger/begivenhed_deltager/slet/".$naeste_session['id']."/".$ingame['ingame_id']."/session/".$kampagne['id'],
					" ",
					"class='terninger_frameld' style='float:right;' title='Frameld ".$ingame['ingame_navn']." ".$naeste_session['navn']." '"
				);	?>

		
			<?
			}
		?>




	
			<input type="hidden" name="vinkel" value="session">
			<input type="hidden" name="kampagne_id" value="<? echo $kampagne['id']; ?>">
			<input type="hidden" name="deltager_id" value="<? echo $deltager_ingame['ingame_id']; ?>">

			</form>






		<h2 class="ink" >
			<? echo anchor("core/vis/se/begivenhed/".$naeste_session['id'],$naeste_session['navn'],"class='ink'");?>
				</h2><p class="ink" style="font-size:12px;">
					<span class="rubrik" style="font-weight:bold;">Dato:</span> <? echo date('d-m-Y ',$naeste_session['offgame_start']);?><br>
					<span class="rubrik" style="font-weight:bold;">kl:</span> <? echo date('H:i',$naeste_session['offgame_start']);?>
				</p>
		
			
	

		</h3>
		<br>
		<h4 class="rubrik">
			Tilmeldte
		</h4>
	


		<p class="rubrik" style="padding:0px 0px 10px 0px;font-weight:bold;">
			<?

			foreach($rollespillere as $r2)
			{
				echo $r2['rollespiller']." aka <span class='ink'>".$r2['karakter']."</span><br/>";
			}

			?>
		</p>
	</div>
	<?	}	?>		



	<?/*

		echo br(2);
		echo "<h4 class='rubrik'>Seneste Sessioner</h4>";
		echo "<p class='ink'>";
			$sessions_rev = array_reverse($sessions);
			foreach($sessions_rev as $r) 
			{
				echo "<span style='float:right;'>".date('d-m-Y',$r['offgame_start'])."</span>";
				echo "<b class='rubrik'>".$r['nummer']."</b> ";
				echo anchor("core/vis/se/begivenhed/".$r['id'],$r['navn'],"class='ink'");
				echo "<br/>";
			}
		echo "</p>";

*/
}
else
{
	echo "Der er ingen session i denne kampagne";
}

	?>

